package com.lm.hutool.example;

import cn.hutool.core.io.FileUtil;

import java.io.File;

public class HutoolIoExample {
    public static void main(String[] args) {
        // 写入文件
        File file = FileUtil.writeUtf8String("你好，Hutool！", "test.txt");
        System.out.println("文件写入成功：" + file.getAbsolutePath());

        // 读取文件
        String content = FileUtil.readUtf8String("test.txt");
        System.out.println("文件内容：" + content);

        // 删除文件
        boolean isDeleted = FileUtil.del(file);
        System.out.println("文件删除：" + (isDeleted ? "成功" : "失败"));
    }
}